<%@ page language="java" contentType="text/html;charset=UTF-8"
   	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<LINK REL="SHORTCUT ICON" HREF="images/icon.jpg"> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
	<center>
		<c:if test="${fn:length(annlist)>0}">
			<table cellpadding="0" cellspacing="0" border="0" width="700">
				<tr>
					<td colspan="3" class="tableheader" style="border: #AAA solid 1px;">សេចក្តីជូនដំណឹងថ្មីៗ</td>
				</tr>
				<tr height="10px"><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>
					<c:forEach var="x" begin="0" end="${rowann-1}" step="1" varStatus ="status">
						<tr>
							<td class="colSpan" colspan="3"><label style="cursor: pointer;color:#0044FF" class="newsTitle" onclick="javascript:window.open('Announcement_Files/${annlist[x].FILE_NAME}')"><c:out value="${annlist[x].ANN_TITLE}"/></label></td>
						</tr>
							<tr height="5px"><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;"> </td></tr>
						<tr>
							<td width="22" style="border-left: #CCC solid 1px;">&nbsp;</td>
							<td valign="top" class="ContentText"><div><c:out value="${annlist[x].ANN_DESC}"/></div></td>
							<td width="20" style="border-right: #CCC solid 1px;">&nbsp;</td>
						</tr>
						<tr>
							<td height="40" style="border-left: #CCC solid 1px;"></td>
							<td align="left"​ valign="middle">
								<table width="100%" cellpadding="0" cellspacing="0" border="0">
									<tr valign="middle">
										<td width="25"><img alt="" src="images/pdficon.png"></td>
										<td><label style="cursor: pointer;color:#0044FF" onclick="javascript:window.open('${annlist[x].FILE_PATH}${annlist[x].FILE_NAME}')">ចុចត្រង់នេះដើម្បីទាញយកឯកសារ</label></td>
									</tr>
								</table>
							</td>
							<td style="border-right: #CCC solid 1px;"></td>
						</tr>
						<c:if test="${x<rowann-1}">
							<tr height="10px">
								<td colspan="2" style=" padding-left:12px; border-left: #CCC solid 1px;"><hr size="1" color="#ccc"></td>
								<td style="border-right: #CCC solid 1px;"></td>
							</tr>	
						<tr><td colspan="3" style="border-right: #CCC solid 1px;border-left: #CCC solid 1px;" height="5"></td></tr>	
						</c:if>
					</c:forEach>
					<tr height="15px" ><td colspan="3" style="border-top: #CCC solid 1px;">&nbsp;</td></tr>	
			</table>
			<br>	
		</c:if>	
		<c:if test="${fn:length(newslist)>0}">
			<table  cellpadding="0" cellspacing="0" width="700">
				<tr height="25px">
					<td colspan="3" class="tableheader" style="border: #AAA solid 1px;">ព័ត៌មាន និងព្រឹត្តិការណ័ថ្មីៗ</td>
				</tr>
				<tr height="10px"><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>
					<c:forEach var="x" begin="0" end="${rownews-1}" step="1" varStatus ="status">
						<tr>
							<td valign="top" style="padding-left: 15px; border-left: #CCC solid 1px;"><a href="news_events_full_story.html?id=${newslist[x].NEWS_ID}"><img src="News_Event_Files/Front_Images/${newslist[x].FRONT_IMAGE_FILE}"></a></td>
							<td align="left" valign="top" style="padding-left: 15px;" class="ContentText">
								<a href="news_events_full_story.html?id=${newslist[x].NEWS_ID}" class="newsTitle"><c:out value="${newslist[x].NEWS_TITLE}"/></a><br/>
								<c:choose>
									<c:when test="${fn:length(newslist[x].NEWS_DESC)>=300}">
										<p align="justify"><c:out value="${fn:substring(newslist[x].NEWS_DESC,0,300)}"/>...</p>
									</c:when>
									<c:otherwise>
										<p align="justify"><c:out value="${newslist[x].NEWS_DESC}"/></p>
									</c:otherwise>
								</c:choose>
							</td>
							<td width="15" style="border-right: #CCC solid 1px;">&nbsp;</td>
						</tr>
						<tr height="10px" ><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>	
					</c:forEach>
					<tr height="10px" ><td colspan="3" style="border-top: #CCC solid 1px;">&nbsp;</td></tr>	
			</table>
			<br>
		</c:if>
		<c:if test="${fn:length(vdolist)>0}">	
			<table  cellpadding="0" border="0" cellspacing="0" width="700">
				<tr height="25px">
					<td colspan="6" class="tableheader" style="border: #AAA solid 1px;">វីដេអូថ្មីៗ</td>
				</tr>
				<tr height="10px"><td colspan="6" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>
			<c:forEach var="x" begin="1" end="2" step="1" varStatus ="status">
			<tr valign="top">
				<td width="10" style="border-left: #CCC solid 1px;"> </td>
				<c:forEach var="i" begin="${(x*4)-4}" end="${(x*4)-1}" step="1" varStatus ="status">
				<td width="170" align="center">
					<c:if test="${i<=fn:length(vdolist)-1 }">
						<a href="view_video.html?video_id=${vdolist[i].FILE_ID}"><img src="${vdolist[i].FILE_PATH}/Images/${vdolist[i].IMAGE_NAME}" width=150px></a><br>
						<a href="view_video.html?video_id=${vdolist[i].FILE_ID}"><b><c:out value="${vdolist[i].FILE_TITLE}"></c:out></b></a><br/>
						<span style="font-size: 9px;color: #444;"><c:out value="${vdolist[i].VIEW_NUMBER}"></c:out> ទស្សនា</span>
					</c:if>
				</td>
				</c:forEach>
				<td width="10" style="border-right: #CCC solid 1px;">&nbsp;</td>
			</tr>
			<tr height="10px" ><td colspan="6" style="border-left: #CCC solid 1px; border-right: #CCC solid 1px;">&nbsp;</td></tr>	
			</c:forEach>
			<tr height="10px" ><td colspan="6" style="border-left: #CCC solid 1px; border-right: #CCC solid 1px;">&nbsp;</td></tr>	
			<tr height="10px" ><td colspan="6" style="border-top: #CCC solid 1px;">&nbsp;</td></tr>	
			</table>
			<br>
		</c:if>
		<c:if test="${fn:length(courselist)>0}">	
			<table  cellpadding="0" cellspacing="0" width="700">
				<tr height="25px">
					<td colspan="3" class="tableheader" style="border: #AAA solid 1px;">វគ្គសិក្សាថ្មីៗ</td>
				</tr>
				<tr height="10px"><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>
				<c:forEach var="i" begin="0" end="${rowcourse-1}" step="1" varStatus ="status">
					<tr valign="top">
						<td style="padding-left: 15px; border-left: #CCC solid 1px;">&nbsp;</td>
						<td align="left">
								<a href="view_course.html?course_id=${courselist[i].COURSE_ID}"><b><c:out value="${courselist[i].COURSE_NAME}"></c:out></b></a>&nbsp;<span style="color: #333; font-size: 9px;"></span>
								<p align="justify" style=" color: #333;font-size: 11px; line-height: 15px;">
									<c:choose>
										<c:when test="${fn:length(courselist[i].COURSE_DESC)>=350}">
											<c:out value="${fn:substring(courselist[i].COURSE_DESC,0,350)}"/>...
										</c:when>
										<c:otherwise>
											<c:out value="${courselist[i].COURSE_DESC}"/>
										</c:otherwise>
									</c:choose>
								</p>
						</td>
						<td width="15" style="border-right: #CCC solid 1px;">&nbsp;</td>
					</tr>
					<tr height="10px" ><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>
				</c:forEach>
				<tr height="10px" ><td colspan="3" style="border-top: #CCC solid 1px;">&nbsp;</td></tr>	
			</table>
			<br>
		</c:if>
		<c:if test="${fn:length(articlelist)>0}">
			<table  cellpadding="0" cellspacing="0" width="700">
				<tr height="25px">
					<td colspan="3" class="tableheader" style="border: #AAA solid 1px;">អត្ថបទថ្មីៗ</td>
				</tr>
				<tr height="10px"><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>
				<c:forEach var="i" begin="0" end="${rowarticle-1}" step="1" varStatus ="status">
					<tr valign="top">
						<td style="padding-left: 15px; border-left: #CCC solid 1px;">&nbsp;</td>
						<td align="left">
								<a href="view_article.html?article_id=${articlelist[i].ARTICLE_ID}"><b><c:out value="${articlelist[i].ARTICLE_TITLE}"></c:out></b></a>&nbsp;<span style="color: #333; font-size: 9px;"></span>
								<p align="justify" style=" color: #333;font-size: 11px; line-height: 15px;">
									<c:choose>
										<c:when test="${fn:length(articlelist[i].ARTICLE_DESC)>=350}">
											<c:out value="${fn:substring(articlelist[i].ARTICLE_DESC,0,350)}"/>...
										</c:when>
										<c:otherwise>
											<c:out value="${articlelist[i].ARTICLE_DESC}"/>
										</c:otherwise>
									</c:choose>
								</p>
						</td>
						<td width="15" style="border-right: #CCC solid 1px;">&nbsp;</td>
					</tr>
					<tr height="10px" ><td colspan="3" style="border-right: #CCC solid 1px; border-left: #CCC solid 1px;">&nbsp;</td></tr>
				</c:forEach>
				<tr height="10px" ><td colspan="3" style="border-top: #CCC solid 1px;">&nbsp;</td></tr>	
			</table>
			<br>
		</c:if>
	</center>
</body>
</html>